
#ifndef _TCPCLIENT_H_
#define _TCPCLIENT_H_

class TcpClient : public QObject
{
	Q_OBJECT
public:
	explicit TcpClient(QObject *parent = Q_NULLPTR);
	~TcpClient();

	public Q_SLOTS:
	void OnStart(void);

	Q_SIGNALS:
	void socket_receive(QByteArray data);

	private Q_SLOTS:
	void tcp_connected(void);
	void tcp_disconnected(void);
	void processError(QAbstractSocket::SocketError socketError);
	void processReadyRead(void);

	void On_TimeOut(void);
private:
	void connect_to_Server(void);
	void trigger_timer(void);

	QTcpSocket *mTcpSocket;
	QTimer *mTimer;
};


#endif

